package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @date: 2021/3/29 0029 17:44
 * @description: 品牌
 */
public interface BrandMapper extends BaseMapper<Brand> {

    void saveCategoryAndBrand(@Param("bid") Long id, @Param("cids") List<Long> cids);

    @Select("SELECT * FROM `tb_brand` b,`tb_category_brand` cb WHERE b.`id`=cb.`brand_id` AND cb.`category_id` = #{id};")
    List<Brand> findBrandsByCid(Long id);
}
